import React, { useState } from "react";

import logo from "./logo.svg";
import "./App.css";
import "./1.png";

import l from "./2.weqweqweqweqw";

function App() {
  const [list, setList] = useState<string | number | number[]>(1);

  // 类型保护
  if (typeof list === "number") {
    const a = list + 1;
  }

  return (
    <div className="App">
      <header className="App-header">
        <img src={logo} className="App-logo" alt="logo" />
        <p>{/* Edit <code>src/App.tsx</code> and save to reload. */}</p>
        <a
          className="App-link"
          href="https://reactjs.org"
          target="_blank"
          rel="noopener noreferrer"
        >
          Learn React
        </a>
      </header>
    </div>
  );
}

export default App;

// 类型别名

type myNumber = number;

const aaa: myNumber = 1;
